Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses deployment issues by consolidating API endpoint configuration and fixing provider selection logic. The changes centralize hardcoded API URLs into a configuration system and resolve duplicate condition handling for the Gemini AI provider.
- Replaces hardcoded API URLs with centralized endpoint configuration
- Adds fallback logic for API base URL configuration using environment variables or window origin
- Fixes duplicate Gemini provider handling in backend endpoints
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/views/GraphRAGPanel.tsx | Replaces hardcoded API URLs with centralized endpoint constants |
| src/lib/config.ts | Adds GraphRAG endpoint definitions and improves API base URL configuration with fallback logic |
| backend/app/main.py | Adds duplicate condition handling for "gemini" provider selection |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| elif provider == "gemini": | ||
| # Support direct "gemini" provider selection from frontend | ||
| api_key = api_keys.get("geminiKey") or config_manager.get("ai_providers.google_genai.api_key", "") | ||
| graphrag_api_keys = {"geminiKey": api_key} |
There was a problem hiding this comment.
This condition is identical to the existing 'google_genai' condition above it (lines 754-756). Consider consolidating these conditions using 'elif provider in ["google_genai", "gemini"]:' to avoid code duplication.
| elif provider == "gemini": | ||
| # Support direct "gemini" provider selection from frontend | ||
| api_key = api_keys.get("geminiKey") or config_manager.get("ai_providers.google_genai.api_key", "") | ||
| graphrag_api_keys = {"geminiKey": api_key} |
There was a problem hiding this comment.
This condition is identical to the existing 'google_genai' condition above it (lines 885-887). Consider consolidating these conditions using 'elif provider in ["google_genai", "gemini"]:' to avoid code duplication.
| elif provider == "gemini": | ||
| # Support direct "gemini" provider selection from frontend | ||
| api_key = api_keys.get("geminiKey") or config_manager.get("ai_providers.google_genai.api_key", "") | ||
| graphrag_api_keys = {"geminiKey": api_key} |
There was a problem hiding this comment.
This condition is identical to the existing 'google_genai' condition above it (lines 1133-1135). Consider consolidating these conditions using 'elif provider in ["google_genai", "gemini"]:' to avoid code duplication.
No description provided.